#include "../source/server.hpp"


int main()
{
    Socket cli_sock;
    cli_sock.CreateClient(8085, "60.205.245.92");
    for (int i = 0; i < 5; ++i)
    {
        std::string str = "client say: hello bit!";
        cli_sock.Send(str.c_str(), str.size());
        char buf[1024];
        if (cli_sock.Recv(buf, 1023) < 0)
        {
            break;
        }
        DBG_LOG("%s", buf);
        sleep(1);
    }
    //5s钟后不再通信，10s后连接将被关闭掉
    while (1) sleep(1);
    for (int i = 0; i < 5; ++i)
    {
        DBG_LOG("sleep:%d", i + 1);
        sleep(1);
    }
    return 0;
}
